package com.tanjie.blackbean.pojo.response;

/**
 * @author: tanjie
 * @date: 2022-03-30
 **/
public interface ResponseBean {

    default String defaultSuccessMessage() {
        return IResult.DEFAULT_SUCCESS_MESSAGE;
    }

    default Integer defaultSuccessCode() {
        return IResult.DEFAULT_SUCCESS_CODE;
    }

    default String defaultFailureMessage() {
        return IResult.DEFAULT_FAILURE_MESSAGE;
    }

    default Integer defaultFailureCode() {
        return IResult.DEFAULT_FAILURE_CODE;
    }

    ResponseBean create(IResult result, Object data);

    // =============== 成功 ===============

    ResponseBean success();

    ResponseBean successWithMessage(String message);

    ResponseBean success(Object data);

    ResponseBean success(Object data, String message);

    // =============== 失败 ===============

    ResponseBean failure();

    ResponseBean failureWithMessage(String message);

    ResponseBean failure(Object data);

    ResponseBean failure(Object data, String message);

}


